package com.foreknow.ex.oop;

/*
* 构造器(构造方法)
* */
public class ConstructorDemo {
    private  String name;
    private int age;
    private Student[] students;


    public ConstructorDemo(String name, int age){
        this.name = name;
        this.age = age;

        //System.out.println("这是一个构造器。。。");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        ConstructorDemo constructorDemo = new ConstructorDemo("fender",23);
        System.out.println(constructorDemo.getName()+"---"+ constructorDemo.getAge());
    }
}
